package com.sskj.wallet.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.wallet.bean.CreateBean;
import com.sskj.wallet.http.HttpConfig;
import com.sskj.wallet.ui.activity.ImportWalletActivity;


public class ImportWalletActivityPresenter extends BasePresenter<ImportWalletActivity> {

    public void createAccount(boolean isFirst, String coinType, String action, String input, String pwd, String path) {
        httpService.createAccount(isFirst, coinType, action, input, pwd, path)
                .execute(new JsonCallBack<HttpData<CreateBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<CreateBean>> response) {
                        HttpData<CreateBean> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {

                            mView.createSuccess(httpData.getData());
                        }
                    }
                });
    }
}
